#ifndef _DATA_TRANSFER_H
#define _DATA_TRANSFER_H

#include "stm32f4xx.h"

#define USE_HID 0x01
#define USE_U1 0x02
#define USE_U2 0x04

#define T265 0x01
#define CAMERA 0x02
#define CARS 0X04

#define FRAME_HEAD 0xAA

#define LOG_COLOR_BLACK 0
#define LOG_COLOR_RED 1
#define LOG_COLOR_GREEN 2

typedef enum
{
	CSID_X20,
	CSID_X21,
	CSID_X01,
	CSID_X02,
	CSID_X03,
	CSID_X04,
	CSID_X05,
	CSID_X06,
	CSID_X07,
	CSID_X08,
	CSID_X09,
	CSID_X0A,
	CSID_X0B,
	CSID_X0C,
	CSID_X0D,
	CSID_X0E,
	CSID_X0F,
	CSID_X30,
	CSID_X32,
	CSID_X33,
	CSID_X34,
	CSID_X40,
	CSID_X41,
	CSID_XFA,
	CSID_NUM
} _enu_cyclesendid;

typedef union
{
	float data_f;
	unsigned char data_u[4];
} data_float;

typedef union
{
	short int data_int_;
	unsigned char data_u[2];
} data_int_;

extern float t265_x_lpf, t265_y_lpf, t265_z_lpf;
extern data_float t265_posx, t265_posy, t265_posz;
extern u8 fire_area;
extern u16 receive_black_times, receive_red_times;
extern data_int_ camera_black_x, camera_black_y, camera_red_x, camera_red_y;
extern int point_num_2;

void AnoDTRxOneByte(u8 type, u8 data);
void AnoDTRxOneByteUart(u8 data);
void AnoDTRxOneByteUsb(u8 data);
void AnoDTSendStr(u8 type, u8 dest_addr, u8 string_color, char *str);
void ANO_DT_Init(void);
void ANO_DT_Task1Ms(void);

void MYDTRxOneByte(u8 type, u8 data);
void Rcceive_dataGet(u8 data__);
void ANODT_UserDefined_flow(s32 a, s32 b, s32 c, s32 d);
void ANODT_UserDefined_t265(s32 a, s32 b, s32 c);
void ANODT_UserDefined_t265_lpf(s32 a, s32 b, s32 c);
void ANODT_UserDefined_to_car_xy(s32 a, s32 b, s32 c);

#endif
